<template>
	<view class="content">
		<!-- 基础用法，不包含校验规则 -->
		<uni-forms ref="infoForm" :rules="rules" :modelValue="info" labelWidth="70px">
			<uni-forms-item name="avatar" label="头像" required>
				<uni-file-picker 
					v-model="fileLists" 
					limit="1" 
					:del-icon="false" 
					disable-preview 
					:imageStyles="imageStyles"
					return-type="object"
					file-mediatype="image" 
					@select="select">选择</uni-file-picker>
			</uni-forms-item>
			<uni-forms-item name="userName" label="用户名" required>
				<uni-easyinput v-model="info.userName" placeholder="请输入用户名" />
			</uni-forms-item>
			<uni-forms-item name="sex" label="性别" required>
				<uni-data-checkbox v-model="info.sex" :localdata="sexs" />
			</uni-forms-item>
			<uni-forms-item name="phone" label="手机号" required>
				<uni-easyinput v-model="info.phone" placeholder="请输入手机号" />
			</uni-forms-item>
			<uni-forms-item name="email" label="邮箱">
				<uni-easyinput v-model="info.email" placeholder="请输入邮箱" />
			</uni-forms-item>
			<uni-forms-item name="birthday" label="出生日期">
				<uni-datetime-picker type="date" return-type="timestamp" v-model="info.birthday"/>
			</uni-forms-item>
			<uni-forms-item name="city" label="城市">
				<uni-easyinput v-model="info.city" placeholder="请输入城市" />
			</uni-forms-item>
			<uni-forms-item name="sign" label="个性签名">
				<uni-easyinput type="textarea" v-model="info.sign" placeholder="请输入个性签名" />
			</uni-forms-item>
			
		</uni-forms>
		<button type="primary" @click="submit('infoForm')">提交</button>
	</view>
</template>

<script src = "./update.js"></script>

<style lang="scss" src = "./update.scss"></style>
